//package com.example.file_management.mapper;
//
//import com.example.file_management.pojo.material.Task;
//import org.apache.ibatis.annotations.*;
//
//import java.util.List;
//
//@Mapper
//public interface TaskMapper {
//
//    @Insert("INSERT INTO tasks (task_name, task_description, task_status, task_start_time, task_end_time, task_priority, task_owner, create_time, update_time) " +
//            "VALUES (#{taskName}, #{taskDescription}, #{taskStatus}, #{taskStartTime}, #{taskEndTime}, #{taskPriority}, #{taskOwner}, NOW(), NOW())")
//    @Options(useGeneratedKeys = true, keyProperty = "taskId")
//    int insertTask(Task task);
//
//    @Select("SELECT * FROM tasks WHERE task_id = #{taskId}")
//    Task getTaskById(int taskId);
//
//    @Select("SELECT * FROM tasks")
//    List<Task> getAllTasks();
//
//    @Update("UPDATE tasks SET task_name = #{taskName}, task_description = #{taskDescription}, task_status = #{taskStatus}, " +
//            "task_start_time = #{taskStartTime}, task_end_time = #{taskEndTime}, task_priority = #{taskPriority}, " +
//            "task_owner = #{taskOwner}, update_time = NOW() WHERE task_id = #{taskId}")
//    int updateTask(Task task);
//
//    @Delete("DELETE FROM tasks WHERE task_id = #{taskId}")
//    int deleteTask(int taskId);
//}
package com.example.file_management.mapper.material;

import com.example.file_management.pojo.material.Task;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
@JsonSerialize(using = LocalDateTimeSerializer.class)
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
public interface TaskMapper {
    int insertTask(Task task);
    Task getTaskById(int taskId);
    List<Task> getAllTasks();
    int updateTask(Task task);
    int deleteTask(int taskId);
//    @Select("SELECT task_id FROM task_table WHERE task_name = #{taskName}")
//    Long selectTaskIdByTaskName(@Param("taskName") String taskName);
}